package com.matuw.android.util;

import android.app.Activity;
import android.content.Context;
import android.content.ContextWrapper;

/**
 * @author Shihwan
 * @date 2025/6/13
 */
public class ContextUtils {

    public static Activity findActivity(Context context) {
        if (context instanceof Activity) return (Activity) context;
        if (context instanceof ContextWrapper) {
            return findActivity(((ContextWrapper) context).getBaseContext());
        }
        return null;
    }
}
